package cn.zf233.xcloud.config.common;

import cn.zf233.xcloud.util.KaptchaUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by zf233 on 2021/2/19
 * 腾讯防水墙配置
 */
@Configuration
public class KaptchaConfig {

    @Value("${tencent.kaptcha.app_id}")
    private String appId;

    @Value("${tencent.kaptcha.app_secret_key}")
    private String appSecretKey;

    @Bean
    public KaptchaUtil kaptchaUtil() {
        KaptchaUtil kaptchaUtil = new KaptchaUtil();
        kaptchaUtil.setAPP_ID(appId);
        kaptchaUtil.setAPP_SECRET(appSecretKey);
        return kaptchaUtil;
    }
}
